package com.zeyi.chat.mapper;

import com.zeyi.chat.po.ChatGroup;
import com.zeyi.chat.po.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zeyi
 */
public interface GroupMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ChatGroup record);

    int insertSelective(ChatGroup record);

    ChatGroup selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ChatGroup record);

    int updateByPrimaryKey(ChatGroup record);

    //通过群号查找群
    ChatGroup findByGroupCode(@Param("groupCode") String groupCode);

    //添加群成员
    int addGroupMember(@Param("groupId") Integer groupId, @Param("userId") Integer userId);

    //获取所有群成员
    List<User> getGroupMembers(@Param("groupId") Integer groupId);

    int deleteMember(@Param("groupId") Integer groupId, @Param("memberId") Integer memberId);
}